<!DOCTYPE html>
<html xmlns:fb="http://ogp.me/ns/fb#">
    <head>
        <?php echo $this->headMeta(); ?>
        <?php echo $this->headTitle(); ?>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <link rel="shortcut icon" type="image/x-icon" href="<?php echo $this->APP_STATIC_SERVER; ?>/skins/<?php echo $this->APP_TEMPLATE; ?>/<?php echo $this->APP_SKIN; ?>/images/favicon.ico" />
        <?php
        echo $this->headLink()
                ->prependStylesheet($this->APP_STATIC_SERVER . '/skins/' . $this->APP_TEMPLATE . '/' . $this->APP_SKIN . '/css/' . ($this->APP_LANG_RTL ? 'default-rtl.css' : 'template.css'))
                ->prependStylesheet($this->APP_STATIC_SERVER . '/skins/' . $this->APP_TEMPLATE . '/' . $this->APP_SKIN . '/css/jcarousel.css')
                ->prependStylesheet($this->APP_STATIC_SERVER . '/skins/' . $this->APP_TEMPLATE . '/' . $this->APP_SKIN . '/css/jquery.simplemodal.css')
                ->prependStylesheet('http://fonts.googleapis.com/css?family=Open+Sans+Condensed:300&subset=vietnamese');
        
        echo $this->headScript()
                ->prependFile($this->APP_STATIC_SERVER . '/js/jquery.min.js')
                ->appendFile($this->APP_STATIC_SERVER . '/js/jquery.jcarousel.js')
                ->appendFile($this->APP_STATIC_SERVER . '/js/jquery.simplemodal/jquery.simplemodal.min.js')
                ->appendFile($this->APP_STATIC_SERVER . '/js/jquery.validate.min.js')
                ->appendFile('http://www.google.com/recaptcha/api/js/recaptcha_ajax.js')
                //để 3 cái script này tạm ở đây
                ->appendFile($this->APP_STATIC_SERVER. '/js/jquery.simpleWeather.min.js')
                ->appendFile('http://vnexpress.net/Service/Gold_Content.js')
                ->appendFile('http://vnexpress.net/Service/Forex_Content.js');
        ?>
    </head>
    <body>
        <div id="header-wrapper">
            <div id="header-wrapper-1">
                <div id="header">
                    <div id="logo" class="h-left">
                        <a href="#" title="">
                            <img src="<?php echo $this->APP_STATIC_SERVER. '/skins/' . $this->APP_TEMPLATE . '/' . $this->APP_SKIN . '/' ?>images/logo.png" alt="Thực phẩm Bảo An"/>
                        </a>
                    </div><!-- #logo -->
                    <div class="h-right">
                        <div class="h-right-top">
                            <div id="cart">
                                <img src="<?php echo $this->APP_STATIC_SERVER. '/skins/' . $this->APP_TEMPLATE . '/' . $this->APP_SKIN . '/' ?>images/cart.png" alt=""/>
                                <a href="#" title="Kiểm tra giỏ hàng">
                                    <span>Giỏ hàng: </span>
                                    <span id="cart-quanity" class="color-red">0 </span>
                                    <span class="color-red">sản phẩm</span>
                                </a>
                            </div><!-- #cart -->                              
                            <?php echo $this->rWidget('core', 'login', array())?>
                        </div><!-- .h-right-top -->
                        <div class="h-right-middle">
                            <ul id="h-menu">
                                <?php echo $this->rWidget('menu', 'menu', array('id' => 2));?>
                                
                            </ul><!-- #h-menu -->
                        </div><!-- .h-right-middle -->
                        <div class="h-right-bottom">
                            <?php echo $this->rWidget('utility', 'weather', array('place' => 'Hà Nội', 'code' => 'hanoi', 'unit' => 'c')) ?><!-- #weather -->
                            <div id="map-guide">
                                <h4><a href="#">Bản đồ <br/>đường đi</a></h4>
                            </div><!-- #map-guide -->
                        </div><!-- .h-right-bottom -->

                    </div>   <!-- .h-right --> 
                </div><!-- #header -->
            </div><!-- #header-wrapper-1 -->
            <div id="slider-wrapper"><!-- #background-slider -->
                <div id="slider">

                </div>  
                <script type="text/javascript">
                    $(document).ready(function(){
                        var sliderImgs = [
                            {image: '<?php echo $this->APP_STATIC_SERVER. '/skins/' . $this->APP_TEMPLATE . '/' . $this->APP_SKIN . '/' ?>images/banner1.jpg', link: '', 'title': 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. ', desc: 'Suspendisse ut auctor sapien. Etiam erat quam, porttitor facilisis malesuada non, vulputate in libero. Nam rutrum cursus vestibulum. Duis fringilla, nulla sit amet '} ,
                            {image: '<?php echo $this->APP_STATIC_SERVER. '/skins/' . $this->APP_TEMPLATE . '/' . $this->APP_SKIN . '/' ?>images/banner2.jpg', link: '', 'title': 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. ', desc: 'Suspendisse ut auctor sapien. Etiam erat quam, porttitor facilisis malesuada non, vulputate in libero. Nam rutrum cursus vestibulum. Duis fringilla, nulla sit amet '} ,
                        ];
                        preloadImage(sliderImgs);
                        for(var i = 0; i < sliderImgs.length; i++){
                            var slideImg = $('<div/>').addClass('slideimg').attr('id', 'slideimg' + (i+1));
                            slideImg.append($('<img src="' + sliderImgs[i].image + '" alt=""/>' ));
                            slideImg.append('<div class="title"><h4><a href="' + sliderImgs[i].link + '">' + sliderImgs[i].title + '</a></h4></div>');
                            slideImg.append($('<div class="description"/>').html(sliderImgs[i].desc));
                            slideImg.hide();
                            $('#slider').append(slideImg);
                        }
                        startSlide();
                    });
                    function preloadImage(photos) {
                        var img = new Image();
                        for ( var i = 0; i < photos.length;i++) {
                            img.src = photos[i].image;
                        }
                    }
                    function startSlide(){
                        if($('#slider .slideimg.current').length == 0){
                            $('#slider .slideimg').eq(0).addClass('current').fadeIn(500);
                        }
                        setInterval(function(){
                            
                            var current = $('#slider .slideimg.current');
                            var index = current.index();
                                
                            if( index + 1 ==  $('#slider .slideimg').length) index = -1;
                            current.removeClass('current').fadeOut(1000);
                                
                            $('#slider .slideimg').eq(index + 1).addClass('current').fadeIn(1500);
                                
                        },3000);
                        
                        
                    }
                    
                   
                </script>
            </div>
        </div><!-- #header-wrapper -->
        <div id="main">
            <?php echo $this->rWidget('product', 'featuredproducts', array());?><!-- #feature product--> 
            <div id="m-left">
                <?php echo $this->rWidget('category', 'categories', array());?>
                <?php echo $this->rWidget('news', 'featured', array('limit' => 5)) ?><!--#featured-news --> 
                <?php echo $this->rWidget('utility', 'accesscounter', array())?><!-- #access-counter --> 
                <div id="gold-price" class="small-box">
                    <div class="box-title"><h5>Giá vàng 9999</h5><h6>Đvt: tr.đ/lượng</h6></div>
                    <table cellspacing="1px" cellpadding="2px" border="0px" class="tbl-goldprice">
                        <tbody>
                            <tr>		
                                <td>Loại</td>
                                <td>Mua</td>
                                <td>Bán</td>
                            </tr>	
                            <tr>		
                                <td>SBJ</td>		
                                <td id="gold-buy"></td>		
                                <td id="gold-sell"></td>	
                            </tr>
                        </tbody>
                    </table>
                    <div class="source">
                        (Nguồn: <a target="_blank" href="http://www.sacombank-sbj.com"><img alt="Sacombank" src="<?php echo $this->APP_STATIC_SERVER. '/skins/' . $this->APP_TEMPLATE . '/' . $this->APP_SKIN . '/' ?>/images/logoSb.gif" /></a>)
                    </div>
                </div>
                <div id="forex" class="small-box">
                    <div class="box-title"><h5>Tỉ giá ngoại tệ</h5></div>
                    <div class="wrapper">
                        <table cellspacing="1px" cellpadding="2px" border="0px" >	
                            <tbody>

                            </tbody>
                        </table>
                    </div>
                    <div class="source">
                        (Nguồn: <a target="_blank" href="http://www.eximbank.com.vn"><img src="<?php echo $this->APP_STATIC_SERVER. '/skins/' . $this->APP_TEMPLATE . '/' . $this->APP_SKIN . '/' ?>/images/logo-EXIM-2.gif" alt="Eximbank"/></a>)
                    </div>
                </div>
                <script type="text/javascript">
                    $(document).ready(function(){
                        
                        if(vGoldSbjBuy != 'undefined'){
                            $('#gold-buy').html(vGoldSbjBuy);
                            $('#gold-sell').html(vGoldSbjSell);
                        }
                        if(vForexs != 'undefined'){
                            for(var i=0; i< vForexs.length; i++){
                                $('#forex table tbody').append('<tr><td>' + vForexs[i]+ '</td><td>'+ vCosts[i]+ '</td></tr>');
                            }
                        }
                        

                    });
                </script>
            </div><!-- #m-left -->
            <?php echo $this->layout()->content ;?>
            <div id="m-right">
                <?php echo $this->rWidget('product', 'search', array())?><!-- #search --> 
                <div id="support" class="white-box">
                    <div class="box-title"><h3>Hỗ trợ trực tuyến</h3></div>
                    <ul>
                        <li>
                            <img src="<?php echo $this->APP_STATIC_SERVER. '/skins/' . $this->APP_TEMPLATE . '/' . $this->APP_SKIN . '/' ?>images/phone.gif" alt=""/>
                            <span> Hotline: 0904239144</span>
                        </li>
                        <li>
                            <a href="ymsgr:sendIM?chit189"><img src="http://opi.yahoo.com/online?u=chit189&amp;m=g&amp;t=5" >
                                <span> Yahoo hỗ trợ kĩ thuật 1</span></a>
                        </li>	
                        <li>
                            <a href="ymsgr:sendIM?chit189"><img src="http://opi.yahoo.com/online?u=chit189&amp;m=g&amp;t=5">
                                <span> Yahoo hỗ trợ kĩ thuật 1</span></a>
                        </li>
                        <li>
                            <a href="mailto:tronghm@idgit.com.vn">
                                <img src="<?php echo $this->APP_STATIC_SERVER. '/skins/' . $this->APP_TEMPLATE . '/' . $this->APP_SKIN . '/' ?>images/mail.gif" alt=""/>
                                <span> Mail tư vấn</span>
                            </a>
                        </li>
                    </ul>
                </div><!-- #support -->
                <?php echo $this->rWidget('mail', 'feedbacklist', array()) ?><!-- #feed-back -->
            </div><!-- #m-right -->
            <div id="m-footer" class="clearfix">
                <div class="wrapper">
                </div>
            </div>
        </div><!-- #main -->
        <div id="footer-outter">
            <div id="footer">
                <div id="introduce">
                    <h1>Giới thiệu cửa hàng</h1>
                    <a class="footer-logo" href="#"><img src="<?php echo $this->APP_STATIC_SERVER. '/skins/' . $this->APP_TEMPLATE . '/' . $this->APP_SKIN . '/' ?>images/footer-logo.png" alt=""/></a>
                    <p>
                        Suspendisse ut auctor sapien. Etiam erat quam, porttitor facilisis malesuada non, vulputate in libero. Nam rutrum cursus vestibulum. Duis fringilla, nulla sit amet 
                    </p>
                    <a class="read-more" href="#">Xem thếm</a>
                </div>
                <div id="timer">
                    <h1>Thời gian bán hàng</h1>
                    <div class="lunch">
                        <p>Monday - Friday: <span class="time">11:00 am to 03:00 pm</span></p>
                        <p>Friday - Saturday: <span class="time">11:00 am to 03:00 pm</span></p>
                        <p>Sunday: <span class="time">Closed</span>
                    </div>
                    <div class="dinner">
                        <p>Monday - Friday: <span class="time">11:00 am to 03:00 pm</span></p>
                        <p>Friday - Saturday: <span class="time">11:00 am to 03:00 pm</span></p>
                        <p>Sunday: <span class="time">Closed</span>
                    </div>
                </div>
                <div id="contact">
                    <h1>Liên hệ</h1>
                    <div class="call-out">
                        <ul>
                            <li class="phone">Phone: <span class="label">0904085263</span></li>
                            <li class="email">Email: <a href="mailto:tronghm@idgit.com.vn">tronghm@idgit.com.vn</a></li>
                            <li class="website">Website: <a href="http://idgit.com.vn">http://idgit.com.vn</a></li>
                        </ul>	
                    </div>
                </div>
            </div>
        </div>
		<?php echo $this->rWidget('mail', 'feedback', array()) ?>
    </body>
</html>